using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._TopographicProductionTools._DataManagement._Generalization
{
    /// <summary>
    /// <para>Remove Small Lines</para>
    /// <para>Removes lines that are shorter than a specified minimum length and do not connect to other features on one end.</para>
    /// <para>移除短于指定最小长度且一端不连接到其他要素的线。</para>
    /// </summary>    
    [DisplayName("Remove Small Lines")]
    public class RemoveSmallLines : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public RemoveSmallLines()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The features that will have small lines eliminated.</para>
        /// <para>将消除小线条的功能。</para>
        /// </param>
        /// <param name="_minimum_length">
        /// <para>Minimum Length</para>
        /// <para>The minimum length for input lines. Features shorter than this distance will be deleted.</para>
        /// <para>输入行的最小长度。短于此距离的要素将被删除。</para>
        /// </param>
        public RemoveSmallLines(object _in_features, string? _minimum_length)
        {
            this._in_features = _in_features;
            this._minimum_length = _minimum_length;
        }
        public override string ToolboxName => "Topographic Production Tools";

        public override string ToolName => "Remove Small Lines";

        public override string CallName => "topographic.RemoveSmallLines";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_features, _minimum_length, _maximum_angle, _in_intersecting_features, _recursive.GetGPValue(), _output_features, _split_input_lines.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The features that will have small lines eliminated.</para>
        /// <para>将消除小线条的功能。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Minimum Length</para>
        /// <para>The minimum length for input lines. Features shorter than this distance will be deleted.</para>
        /// <para>输入行的最小长度。短于此距离的要素将被删除。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Length")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _minimum_length { get; set; }


        /// <summary>
        /// <para>Maximum Angle</para>
        /// <para>Any line below the minimum length that is within the defined angle of a consecutive line segment will be kept.</para>
        /// <para>任何低于连续线段定义角度内的最小长度的线都将被保留。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Angle")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _maximum_angle { get; set; } = null;


        /// <summary>
        /// <para>Intersecting Features</para>
        /// <para>Additional intersecting features that the input features can be compared against when determining whether the feature is a small line.</para>
        /// <para>在确定要素是否为小线时，可以与输入要素进行比较的其他相交要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Intersecting Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _in_intersecting_features { get; set; } = null;


        /// <summary>
        /// <para>Recursive</para>
        /// <para><xdoc>
        ///   <para>Indicates the method used to remove small lines on the line features.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—All the small lines on lines are deleted. The remaining lines are not analyzed to see if they are small lines. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—The small lines are deleted from the lines and the remaining lines are analyzed to see if they are considered small lines. If they do not meet the Minimum Length value, they are considered small lines and deleted.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指示用于移除线要素上的小线的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 删除线上的所有小线。不分析其余线以查看它们是否为小线。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 从行中删除小线，并分析其余行以查看它们是否被视为小线。如果它们不符合“最小长度”值，则它们将被视为小行并被删除。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Recursive")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _recursive_value _recursive { get; set; } = _recursive_value._false;

        public enum _recursive_value
        {
            /// <summary>
            /// <para>RECURSIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("RECURSIVE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NON_RECURSIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NON_RECURSIVE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Layer</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Layer")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _output_features { get; set; }


        /// <summary>
        /// <para>Split Input Lines</para>
        /// <para><xdoc>
        ///   <para>Splits the input line feature at all intersections before determining which small lines to remove.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—All lines in the input feature class are split at intersections to ensure topological integrity. The length of the split features, not the original feature geometries, will be considered when applying the minimum length value to determine small lines. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Does not split lines before determining which lines to remove. Uses the length of the input feature geometries when applying the minimum length value to determine small lines.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>在确定要移除的小线之前，分割所有相交点处的输入线要素。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 输入要素类中的所有线均在交点处分割，以确保拓扑完整性。在应用最小长度值来确定小线时，将考虑分割要素的长度，而不是原始要素几何。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 （Unchecked） - 在确定要移除的线之前不拆分线。在应用最小长度值来确定小线时，使用输入要素几何的长度。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Split Input Lines")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _split_input_lines_value _split_input_lines { get; set; } = _split_input_lines_value._true;

        public enum _split_input_lines_value
        {
            /// <summary>
            /// <para>SPLIT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SPLIT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_SPLIT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_SPLIT")]
            [GPEnumValue("false")]
            _false,

        }

        public RemoveSmallLines SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}